{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 1、有如下变量test，请按照要求实现每个功能：\n",
    "#####  test = '  Hello my world! '\n",
    "##### a、移除test变量对应值的两边的空格，并输出‘Hello my world!’\n",
    "##### b、将‘Hello my world!’变成大写，并输出结果，将结果赋给test变量\n",
    "##### c、请输出test变量对应值的前三个字符"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "test = '  Hello my world! '"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 2、现有字符串 'Life is short,you need Python'\n",
    "##### 考虑使用两种方法将字符串中的Python提取出来\n",
    "##### 方法一：使用切片提取\n",
    "##### 方法二：使用split()方法来提取"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "str_python = 'Life is short,you need Python'"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 3、有如下a和b两个变量，请问a&b的结果为（True/False）？"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "a = (4<=5)\n",
    "b = (1<2) & ('a'=='A')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 4、实现一个整数加法计算器:\n",
    "##### ① 现有两个字符串a = '6'，b = '7'；\n",
    "##### ② 通过int()将字符串转换为整数进行加法计算"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### （选做）请将字符串'abcdefg'输出成为'GFEDCBA'\n",
    "##### Tips：反序输出考虑步长设置为-1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
